package threading;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo22 {
    public static void main(String[] args) {
        //构造一个固定10线程的线程池
        ExecutorService pool = Executors.newFixedThreadPool(10);
        //不会设定固定值，按需创建 用完之后不会立即销毁 留着以备后用
        //Executors.newCachedThreadPool();
        pool.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        });
    }
}
